<?
if (isset($_GET['lmk']) && !empty($_GET['lmk']))
{
	if (is_dir('mod/'.$_GET['lmk']))
	{
		if (!isset ($_GET['lpk']) || empty($_GET['lpk']) || $_GET['lpk']=='index.php')
			include ('mod/'.$_GET['lmk'].'/index.php');
		else
		{
			if (file_exists('mod/'.$_GET['lmk'].'/'.$_GET['lpk'].'.php'))
				include ('mod/'.$_GET['lmk'].'/'.$_GET['lpk'].'.php');
			else
				echo "<meta http-equiv='refresh' content='0;url=/index.php?lmk=error&act=404'>";
		}
	}else
		echo "<meta http-equiv='refresh' content='0;url=/index.php?lmk=error&act=404'>";
}elseif (isset($_GET['op']) && !empty($_GET['op']))
{
	if (is_dir('admin/'.$_GET['op']))
	{
		if (!isset ($_GET['lpk']) || empty($_GET['lpk']) || $_GET['lpk']=='index.php')
			include ('admin/'.$_GET['op'].'/index.php');
		else
		{
			if (file_exists('admin/'.$_GET['op'].'/'.$_GET['lpk'].'.php'))
				include ('admin/'.$_GET['op'].'/'.$_GET['lpk'].'.php');
			else
				echo "<meta http-equiv='refresh' content='0;url=/index.php?lmk=error&act=404'>";
		}
	}else
		echo "<meta http-equiv='refresh' content='0;url=/index.php?lmk=error&act=404'>";
}else
	include('mainpage.php');
?>